<h3><%= current_user.username %>发布的商品</h3>

<table>
    <thead>
    <tr>
      <th>商品名</th>
      <th>描述</th>
      <th>成色</th>
      <th>区域</th>
      <th>价格</th>
      <th>编辑</th>
    </tr>
    </thead>
   
    <tbody>
    <% @goods.each do |good| %>
      <tr>
        <td><%= link_to  truncate(good.name, length: 15, omission: '...'), good_path(good) %></td>
        <td><%= truncate(good.description, length: 30, omission: '...')  %></td>
        <td><%= good.quality %></td>
        <td><%= good.user.region%></td>
        <td><%= good.price %></td>
        <td><%= button_to "编辑", edit_good_path(good) %></td>
      </tr>
    <% end %>
    </tbody>
</table>